﻿define(function () {
    return {
        Load: function (components) {
            var defererds = [];
            (function (list) {
                $.each(list, function (index, item) {
                    var htmlPath = "/Content/require/text.js!/Content/vueTemplates/" + item + ".html";
                    var jsPath = "/Content/vueTemplates/" + item + ".js";
                    var defererd = $.Deferred();
                    require([htmlPath, jsPath], function (html, js) {
                        js.Init(item, html, function () {
                            defererd.resolve();//单个组件加载完成
                        });
                    });
                    defererds.push(defererd);
                });
            })(components);
            return $.when(defererds);//所有组件加载完成的回调
        }
    };
});